package pri.jz.keeper.ui.content.personal.setting

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.lifecycle.ViewModel
import pri.jz.keeper.ui.base.BaseActivity
import pri.jz.keeper.ui.base.BaseViewModel
import pri.jz.keeper.ui.theme.KeeperTheme

class SettingActivity : BaseActivity() {
    private val viewModel: SettingViewModel by viewModels()
    @Composable
    override fun OnCreateView() {
        SettingView()
    }

    override suspend fun onObserver() {
        viewModel.state.collect {state ->
            when (state) {
                SettingState.FINISH -> finish()
                SettingState.DEFAULT -> {}
            }

        }
    }


    override fun getViewModel(): BaseViewModel {
        return viewModel
    }
}
